home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / mpimagelib.lha / include / libraries / MPImage.h
C/C++ Source or Header  |  1997-02-16  |  4KB  |  157 lines

  1. #ifndef LIBRARIES_MPIMAGE_H
  2. #define LIBRARIES_MPIMAGE_H
  3.  
  4. /* mark@topic.demon.co.uk */
  5. /* mpaddock@cix.compulink.co.uk */
  6.  
  7. /* $VER: MPImage.h 7.2 (16.2.97)
  8. */
  9.  
  10. #include <exec/types.h>
  11.  
  12. /* Hook for progress messages */
  13. /* object = 1, (ULONG)message = max-progress */
  14. #define MPIP_MAX        ((APTR)1)
  15. /* object = 2, (ULONG)message = curr-progress */
  16. #define MPIP_CURR        ((APTR)2)
  17. /* object = 3, (UBYTE *)message = Progress-Message */
  18. #define MPIP_MESSAGE    ((APTR)3)
  19.  
  20. /* Load Image stuff */
  21. struct MPImage {
  22.     struct BitMap *BitMap;
  23.     struct E_EBitMap *EGS_BitMap;
  24.     UBYTE *Red;
  25.     UBYTE *Green;
  26.     UBYTE *Blue;
  27.     UWORD Width;
  28.     UWORD Height;
  29.     Object *Object;
  30.     BOOL GreyScale;
  31.     BOOL Cyber;        // V 4.3 - for later use
  32. };
  33.  
  34. /* Default is to remap to screen palette and return a bitmap in BitMap */
  35. /* Only way to free is to call FreeMPImageBitMap */
  36.  
  37. /* return E_EBitMap rather than BitMap */
  38. /* overrides MPIF_RGB */
  39. #define MPIF_EGS                 (1<<0)
  40.  
  41. /* You are free to zero BitMap/EGS_BitMap before calling FreeMPImageBitMap */
  42. /* You must then call FreeBitMap()/E_DisposeBitMap() yourself */
  43. /* Ignored for MPIF_RGB */
  44. /* If screen supplied then clone is screen depth deep if possible */
  45. #define MPIF_CLONEBITMAP    (1<<1)
  46.  
  47. /* Don't remap to the current screen colors */
  48. /* Ignored for MPIF_EGS/RGB */
  49. /* Returns error if 24 bit input */
  50. #define MPIF_NOREMAP            (1<<2)
  51.  
  52. /* return Red, Green, Blue instead of BitMap */
  53. #define MPIF_RGB                (1<<3)
  54.  
  55. /* return Red, Green, Blue instead of BitMap */
  56. /* If image is greyscale then Red, Green and Blue will be the same */
  57. /* and GreyScale will be TRUE */
  58. #define MPIF_GREY                (1<<4)
  59.  
  60. /* As MPIF_GREY but force the input to be remapped to GreyScale */
  61. #define MPIF_FORCEGREY        (1<<5)
  62.  
  63. /* When remapping to grey use linear (not colour based) mapping */
  64. #define MPIF_LINEARGREY        (1<<6)
  65.  
  66. /* Save Image stuff */
  67. /* CAMG mode - data is modeid */
  68. /* If not supplied, or INVALID_ID supplied then internally generated */
  69. #define MPIS_MODE        (TAG_USER + 1)
  70.  
  71. /* Save Format - data is (char *) */
  72. /* If not supplied or NULL then save BW16 */
  73. #define MPIS_FORMAT    (TAG_USER + 2)
  74. /* 16 colour grey scale */
  75. #define MPI_BW16        "BW16"
  76. /* 256 colour grey scale */
  77. #define MPI_BW256        "BW256"
  78. /* HAM 6 fixed (internal) palette */
  79. #define MPI_HAM6        "HAM6"
  80. /* HAM 8 fixed (internal) palette */
  81. #define MPI_HAM8        "HAM8"
  82. /* 24 bit ILBM */
  83. #define MPI_ILBM24    "ILBM24"
  84. /* P6 (or P5 if all planes are the same) PPM format */
  85. #define MPI_PPM        "PPM"
  86. /* HAM 6 generate best palette */
  87. #define MPI_HAM6P        "HAM6P"
  88. /* HAM 8 generate best palette */
  89. #define MPI_HAM8P        "HAM8P"
  90. /* COLOUR generate palette */
  91. #define MPI_COLOUR    "COLOUR"
  92. /* EHB generate palette */
  93. #define MPI_EHB        "EHB"
  94. /* JPEG (requires env:mpimage/cjpeg to be set e.g. 'cjpeg "%s" "%s"') */
  95. #define MPI_JPEG        "JPEG"
  96. /* PNG (requires env:mpimage/pnmtopng to be set e.g. 'pnmtopng "%s" >"%s"') */
  97. #define MPI_PNG        "PNG"
  98. /* DCTV3 (requires dctv.library) */
  99. #define MPI_DCTV3        "DCTV3"
  100. /* DCTV4 (requires dctv.library) */
  101. #define MPI_DCTV4        "DCTV4"
  102.  
  103. /* Filename of palette to use - data is (char *) */
  104. /* Overrides internal and generated palettes */
  105. /* Can be NULL */
  106. #define MPIS_PALETTE    (TAG_USER + 3)
  107.  
  108. /* Number of colours to generate/use from palette - data is ULONG */
  109. /* Only used for COLOUR */
  110. /* If not supplied defaults to number of colours in palette (if supplied) */
  111. /* otherwise 16 */
  112. /* If > colours in palette then ignored */
  113. /* max 256, min 2 */
  114. #define MPIS_COLOURS    (TAG_USER + 4)
  115.  
  116. /* Use 12 bit colour palette for COLOUR/EHB */
  117. #define MPIS_12BIT    (TAG_USER + 5)
  118.  
  119. /* Mode name data is char *, overridden by MPIS_MODE - invalid names ignored */
  120. #define MPIS_MODENAME    (TAG_USER + 6)
  121.  
  122. /* V5.0 beta1 */
  123. /* Linear Mapping for BW16/BW256, data is BOOL */
  124. #define MPIS_LINEAR    (TAG_USER + 7)
  125.  
  126. /* V5.0 beta2 */
  127. /* Palette map for BW16/BW256, data is UBYTE * */
  128. #define MPIS_GREYMAP    (TAG_USER + 8)
  129.  
  130. /* V7.0 */
  131. /* UBYTE[768] Palette to use */
  132. #define MPIS_OLDPALETTE (TAG_USER + 9)
  133.  
  134. /* V7.0 */
  135. /* UBYTE[768] Palette to used */
  136. #define MPIS_NEWPALETTE (TAG_USER + 10)
  137.  
  138. /* V7.0 */
  139. /* struct BitMap * BitMap to save to */
  140. #define MPIS_BITMAP (TAG_USER + 11)
  141.  
  142.  
  143. /* Flags for SetMPImageScreen() */
  144. /* Use progress requesters */
  145. #define MPIF_PROGRESS    1
  146.  
  147. /* Process Image stuff V7.0 */
  148. struct MPProcess {
  149.     UBYTE *Red;
  150.     UBYTE *Green;
  151.     UBYTE *Blue;
  152.     UWORD Width;
  153.     UWORD Height;
  154. };
  155.  
  156. #endif
  157.